package com.class05.m_innerclass;

import java.sql.SQLOutput;

public class Test01 {
    public static void main(String[] args) {

        method(new USB() {
            public void open() {
                System.out.println("open");
            }
        });

        System.out.println("-------------------");
        USB usb = method1();
        usb.open();


    }

    //       4.1 匿名内部类复杂用法_当参数传递
    public static void method(USB usb) {
        usb.open();
    }


    //4.2 匿名内部类复杂用法_当返回值返回
    public static USB method1() {
        return new USB() {
            @Override
            public void open() {
                System.out.println("open");
            }
        };
    }
}
